package com.yyh.io2;

import java.io.Serializable;
import java.util.Objects;

public class Student1 implements Serializable {
    private static final long serialVersionUID = 7356831462076138274L;
    //属性
    private transient String name;
    private int age;
    private  double score ;
    private String address;

    public Student1() {
    }

    public Student1(String name, int age, double score, String address) {
        this.name = name;
        this.age = age;
        this.score = score;
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getScore() {
        return score;
    }
    public void setScore(double score) {
        this.score = score;
    }
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student1 student1 = (Student1) o;
        return age == student1.age && Double.compare(student1.score, score) == 0 && Objects.equals(name, student1.name) && Objects.equals(address, student1.address);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, score, address);
    }

    @Override
    public String toString() {
        return "Student1{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                ", address='" + address + '\'' +
                '}';
    }
}
